/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -10 -09
 * Time: 22:28
 */



public class test4 {
    public static void main(String[] args) {
        for (int i = 0; i < 20; i++) {
            int n = i;
            Thread t = new Thread(){
                @Override
                public void run() {
                    System.out.println(n);
                }
            };
            t.start();
            try {
                t.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("ok");
    }
}
